Image capture and storage properties

Description

Specify properties for storing the image. For example, if the bound field is a character field, specify the folder where the image filename should be stored.

These settings only apply when the List image field is set using the 'Image Capture for List-Detail View' action in Action Javascript.
Image Capture Properties dialog
Image Capture Properties dialog

Properties

  • Upload folder

    This property is ignored if the upload target is set to S3.

    When images are uploaded to the Server, they are stored initially in a temporary session storage. Once the record is saved, a permanent file is created on the server. The Upload Folder is where images are permanently stored once they have been uploaded to the server, and the current record is saved. The Upload Folder can be specified as:

    • A relative folder
    • An absolute folder with a drive letter
    • An absolute UNC folder
    • A folder that contains an alias

    If you specify a relative folder, the folder is relative to the location of the component in the application webroot on the server.

    Upload Folder Examples:

    Example
    Description
    images\products

    A relative folder path, relative to the webroot

    [myimages]

    An alias that defines the folder. Aliases are defined in your Web Publishing Profile. For example, you might define an alias called [myimages] that resolves to c:\myimages\productImages.

    [PathAlias.ADB_Path]

    An alias that defines the folder. [PathAlias.ADB_Path] defaults to the location of the workspace directory in the development environment.

    [PathAlias.ADB_Path]\images

    An alias with a folder path.

    c:\images\products

    An absolute folder path. The path is the location on the Server.

    \\images\products

    A UNC (Universal Naming Convention) folder name.

    Uploading to a folder on the server is not supported on Alpha Cloud. Use S3 storage.

  • File exists action

    This property is ignored if the upload target is set to S3.

    The File exists action defines what should happen when a file is uploaded to the server with the same name as a file that already exists. You can either overwrite the existing file or rename the uploaded file.

  • Stored filename transformation expression

    This property is ignored if the upload target is set to S3.

    When an image is uploaded to the server, it's stored as file in the Upload Folder. For example, you might have specified an Upload folder of:

    c:\images\products

    If the user uploads an image called "bike.png", then a file will be created in the Upload folder called:

    c:\images\products\bike.png

    The image filename can be stored as the full file path and file name in the Image field or transformed, for example, by removing the folder path or replacing part of the path with an alias.

    If no transformation expression is defined, the full path and filename will be stored in the field. For example:

    c:\images\products\bike.png

    Suppose you only want to only store part of the filename:

    products\bike.png

    In this case, you will want to transform the filename before it is stored in the Image field. To transform the filename, you create a Transformation Expression. The Transformation Expression is an Xbasic expression that uses special placeholders.

    Placeholder
    Description
    <Filename>

    The uploaded filename, including drive and path

    <ShortFilename>

    The uploaded filename without the drive and path

    In the "bike.png" example, the placeholders resolve to the following values:

    Placeholder
    Value
    <Filename>

    c:\images\products\bike.png

    <ShortFilename>

    bike.png

    To store the filename as "products\bike.png", you would specify the following Transformation Expression:

    "products\<ShortFilename>"

    Here are some additional Transformation Expression examples

    Expression
    Description
    filename_encode("<filename>")

    Encode the filename to use an alias. If an alias called 'ProductImages' (c:\images\products) was defined, would resolve to [ProductImages]\bike.png

    "<filename>"

    Resolves to the uploaded filename (e.g. c:\images\products\bike.png)

    "<ShortFilename>"

    Resolves to the short filename (e.g. bike.png)

    "<PhoneGapAjaxURL>"

    Only meaningful in a Cordova mobile application. Resolves to URL used for Ajax callbacks

    Filename Transformation Expression dialog
    Filename Transformation Expression dialog
  • beforeUploadedFileSave Xbasic

    This property only applies when the image is uploaded to the application server and the Image Capture action's Data capture mode mode has been set to filename. This property is ignored if the upload target is set to S3.

    The beforeUploadedFileSave Xbasic defines is an optional Xbasic function to call prior to saving the file on the server. The Xbasic function is passed an object called e with the following variables:

    Variable
    Description
    e.tmpl

    The UX component definition.

    e.targetName

    The suggested name to use for saving the file.

    e.targetFolder

    The suggested folder where the file should be saved.

    e.listFieldName

    The name of the List field where the uploaded image filename is saved.

    e.listName

    The List name to which the uploaded image is bound.

    e.filenameOnDevice

    The file name on the mobile device.

    Your Xbasic function can set the following values in the e object:

    Variable
    Description
    e.newTargetName

    The filename to use. Overrides e.targetName.

    e.newTargetFolder

    The folder where the image should be stored. Overrides e.targetFolder.

    You can use the beforeUploadedFileSave Xbasic to dynamically set the file name or folder location for the uploaded file. For example:

    function beforeUpload as v (e as p)
        e.newTargetFolder = "otherImages"
    end function
  • afterUploadedFileSave Xbasic

    This property only applies when the image is uploaded to the application server and the Image Capture action's Data capture mode has been set to filename. This property is ignored if the upload target is set to S3.

    The afterUploadedFileSave Xbasic defines is an optional Xbasic function to call after the file has been uploaded and saved on the server. The Xbasic function is passed an object called e with the following variables:

    Variable
    Description
    e.tmpl

    The UX component definition.

    e.filename

    The filename used to save the uploaded file.

    Your Xbasic function can return JavaScript to execute on the client. JavaScript is passed using the e.javascript argument. For example:

    function afterUpload as v (e as p)
        dim fn as c = js_escape(e.filename);
        dim js as c = "alert('"+fn+" has been uploaded.');"
    
        e.javascript = js
    
    end function
  • Create image thumbnails

    If enabled, let's you generate a thumbnail image for the uploaded image. Thumbnails are not supported if the upload target is set to S3.

  • Thumbnail definition

    Defines how the thumbnail image should be generated and stored. You can optionally store the thumbnail in an image field in the List. Thumbnails are not supported if the upload target is set to S3.

  • Store EXIF info

    Requires the Camera with Exif plugin in Cordova mobile apps.

    Check if you'd like to capture and store image EXIF (Exchangeable Image File) information.

  • EXIF Info definition

    Defines the EXIF information to capture and store -- if available.